package com.lwt.hospital.controller;


import com.alibaba.fastjson.JSONObject;
import com.lwt.hospital.dao.DemoDao;
import com.lwt.hospital.service.DoctorService;
import com.lwt.hospital.service.UserService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author 丁兆顺
 * @date 2020/5/18 9:59
 * @desciption
 */
public class BaseController {

    public String getCommonSUCESS(Object bean) {
        JSONObject json = new JSONObject();
        json.put("SUCCESS", true);
        json.put("VALIDATE", true);
        json.put("RESULT", bean);
        json.put("MESSAGE", "成功");
        return json.toJSONString();
    }

    public String getCommonERROR(Object bean) {
        JSONObject json = new JSONObject();
        json.put("SUCCESS", false);
        json.put("VALIDATE", true);
        json.put("RESULT", bean);
        json.put("MESSAGE", "失败");
        return json.toJSONString();
    }












}
